Skip to content

Add dictionary-based construction for NestedSetup - #741

Open
Aschenbath wants to merge 1 commit into
getlogbook:mainfrom
Aschenbath:feat/nested-setup-dict-248
Open

Aschenbath wants to merge 1 commit into
getlogbook:mainfrom
Aschenbath:feat/nested-setup-dict-248

Conversation

@Aschenbath

Copy link
Copy Markdown

Add NestedSetup.from_dict() so applications can build a logging setup from a dictionary, including one loaded from JSON or YAML. Each entry in objects identifies a handler, processor, or flags class and its constructor keyword arguments. The setup preserves the existing order and explicit activation behavior.

The constructor leaves input mappings unchanged, validates class specifications before creating objects, and closes already-created handlers if a later constructor fails. Documentation covers JSON/YAML loading, Python callbacks, and resource ownership.

Closes #248.

Validation:

  • CPython 3.12 on Linux, with gevent and the supported Linux extras: 1,166 passed, 52 skipped using the Python fallback.
  • New regression tests: 48 passed; all 48 fail on the exact upstream base because the API is absent.
  • Independent end-to-end checks passed on Linux and native Windows, including configuration loading, stack scope, and failed-construction cleanup.
  • Sphinx HTML with warnings as errors, 23 documentation tests, Ruff, and the repository's documentation formatter passed.
  • Pure-Python wheel and sdist built successfully and passed Twine checks. A fresh installation of the wheel loaded JSON and wrote the expected UTF-8 log file. The Rust extension was not built locally.

AI disclosure: OpenAI Codex generated the implementation, documentation, tests, and this description. A separate Codex agent reviewed the change and ran independent checks; no independent human review is claimed.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Setup from dict/file feature

1 participant